import React, { useEffect, useState } from 'react'
import instance from '../../api/request'
import { useParams } from 'react-router-dom'

function order() {
  const {id}=useParams()
    const [xq,setXq]=useState('')

    const getData=()=>{
      instance.get(`/api/article/${id}`).then((res)=>{
        console.log(res.data);
        
        setXq(res.data)
      })
    }

    useEffect(()=>{
      getData()
    },[])
  return (
    <div>
      <span>{xq.title}</span>
      <span>{xq.content}</span>
    </div>
  )
}

export default order